package com.yhsimon.realm.member.constant;

import lombok.Getter;

@Getter
public enum ResultCodeEnum {

    SUCCESS(200, "操作成功"),
    LOGIN_ERROR(201, "用户名或者密码错误"),
    VALIDATE_CODE_ERROR(202, "验证码错误"),
    LOGIN_AUTH(208, "用户未登录"),
    USER_NAME_IS_EXISTS(209, "用户名已经存在"),
    SYSTEM_ERROR(9999, "您的网络有问题请稍后重试"),
    NODE_ERROR(217, "该节点下有子节点，不可以删除"),
    DATA_ERROR(204, "数据异常"),
    ACCOUNT_STOP(216, "账号已停用"),
    STOCK_LESS(219, "库存不足"),
    THE_FILE_CANNOT_BE_EMPTY(400, "文件不能为空"),
    THE_FILE_SIZE_CANNOT_EXCEED_2M(400, "文件大小不能超过2M"),

    FILE_UPLOAD_FAILED(400, "文件上传失败,请重新上传或联系管理员"),
    SYSTEM_BUSY(500, "频繁访问，请稍后重试"),
    HOT_SPOT_PARAMETER_CURRENT_LIMITING(500, "热点参数限流，请稍后重试"),
    REQUEST_DOWNGRADE(500, "请求降级，请稍后重试"),
    NO_PERMISSION_TO_ACCESS(500, "无访问权限"),
    ;

    private Integer code;      // 业务状态码
    private String message;    // 响应消息

    private ResultCodeEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }
}
